UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkQ8o0lQUZxwHyssVqJgCuGicby0kPIE4uQ5h6CUbdM='
WHERE
key_id = 'dbb42c82accb0255da9105ddd91e672c86a3ec6e6b822993aa2d90835eebfaf5'
AND (
token = 'NkQ8o0lQUZxwHyssVqJgCuGicby0kPIE4uQ5h6CUbdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)