UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IsHJ6yQwcuaSNXoUwYeCAsYYzUSbZaybXxGsWRgzFjo='
WHERE
key_id = '4859b5f55604cdb5100a057ffc64d71d847d0e589660e81728a8c4767db818c8'
AND (
token = 'IsHJ6yQwcuaSNXoUwYeCAsYYzUSbZaybXxGsWRgzFjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)