UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eYphE70NS/gMrfdoKvR4PICIPyzRwE5k+u3cevASkQA='
WHERE
key_id = '1dc213e89798d941506c307d1a87ce51a919b80989fd8f297d01b5847d48d4f7'
AND (
token = 'eYphE70NS/gMrfdoKvR4PICIPyzRwE5k+u3cevASkQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)