UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nkec4MNj0VJSH9VT6l/UZYwfEvGDpgfI8ireI2bjcZI='
WHERE
key_id = '6f498d36262264cb79d513c313e43e60694e36f5c02b6d343a4df6ce0239cabf'
AND (
token = 'Nkec4MNj0VJSH9VT6l/UZYwfEvGDpgfI8ireI2bjcZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)