UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v/fL6TzMelnVb36YXoElopgyjM1ApfnTfbqYSeuXAuc='
WHERE
key_id = '3059430cef693776d7060023f442b780c2b69a78d65c1705ddd8be3a957f2270'
AND (
token = 'v/fL6TzMelnVb36YXoElopgyjM1ApfnTfbqYSeuXAuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)