UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1jRK1jJIMgZAWGOrSikH22UExdvHu4cQydeozDieW/E='
WHERE
key_id = 'c8561ac3ecc6a8c0f81377b66db283640ff3ea3416b6a1b9c4d8a5f8fe1329de'
AND (
token = '1jRK1jJIMgZAWGOrSikH22UExdvHu4cQydeozDieW/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)