UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SrTrucvCcjiJtfezcWoRHvkPzYnCTCtzsFidlzTIQYs='
WHERE
key_id = '87838c18b0efcce95131143a03028d1e47889132929cf283cd1226d347d43901'
AND (
token = 'SrTrucvCcjiJtfezcWoRHvkPzYnCTCtzsFidlzTIQYs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)