UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bbz4tUrnG9duh/tj3t70NiRd07vRAmkMmeSHzMhxBvA='
WHERE
key_id = '028d5adffe686837a0148c8296bf7135fc555eb877785db7b1d11fc9c154ed44'
AND (
token = 'bbz4tUrnG9duh/tj3t70NiRd07vRAmkMmeSHzMhxBvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)