UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EI1ftc1tbnyx5KsbA89WT32K6n2zVaeL3SILBPH7zeo='
WHERE
key_id = '76fc412c5881398757bacf8fc6e8e150fc3a32b2199698abcc53cfca74458d3a'
AND (
token = 'EI1ftc1tbnyx5KsbA89WT32K6n2zVaeL3SILBPH7zeo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)