UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/z+kd12V6Nu5IlcdQGJsPt+ug58+oAj3h0/BcZj39Nk='
WHERE
key_id = 'e4b900a214bdc72329281a309058a28b2c8f8b788da8d41a12bba2ecc8062e15'
AND (
token = '/z+kd12V6Nu5IlcdQGJsPt+ug58+oAj3h0/BcZj39Nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)