UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XmmU7AckP7ffvRdhghYGp/j+G+fW6nNDBnagFVdo48I='
WHERE
key_id = '537989ab3aad2207487512cddccfacc56140c1a182ec3bcb932f92da2c25f55a'
AND (
token = 'XmmU7AckP7ffvRdhghYGp/j+G+fW6nNDBnagFVdo48I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)