UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C+EJdigCgk0EhpNgaIWcasLrr+ZsArKsUPlmBTdHsQ8='
WHERE
key_id = '33b6e7ff8e714a7f92794db32fbf4d860820d5af099d2065a043cba65d0616cf'
AND (
token = 'C+EJdigCgk0EhpNgaIWcasLrr+ZsArKsUPlmBTdHsQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)