UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hnEw3GiwcZEkS28UdPHp0CQ0+ujdFrMk1ZzB4pEEHbU='
WHERE
key_id = 'ad653f381636f6c3f6906befc8f45efdb733c887c78c2ba449dd959e55a55c4c'
AND (
token = 'hnEw3GiwcZEkS28UdPHp0CQ0+ujdFrMk1ZzB4pEEHbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)