UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UiHnyKdyIdWEgyGSUzXCAyCA0d1Nf4d1AcXmEZWIMPQ='
WHERE
key_id = '282f6bb332ef9a5a894ccd1e208a867dc34fef1a826000362ef08bace386ecb1'
AND (
token = 'UiHnyKdyIdWEgyGSUzXCAyCA0d1Nf4d1AcXmEZWIMPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)