UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/JSkDKvbqyc6C8l2xQveHwY6TnH07llpNATSNwds9/Y='
WHERE
key_id = '6040b266509be654d06939108b93b0b6eb0b552f85ca44256688a52b7468c470'
AND (
token = '/JSkDKvbqyc6C8l2xQveHwY6TnH07llpNATSNwds9/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)