UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/G+SvY2KgShRZ33cQ0jZv1zrc416V18gKJn7zeR2bqc='
WHERE
key_id = 'eb3a6ce4abc6fbb1dafbb20e5f839b63e3f0e3aa8da6e3bc960025ef282a3c17'
AND (
token = '/G+SvY2KgShRZ33cQ0jZv1zrc416V18gKJn7zeR2bqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)