UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x0FvGAuP8WQPmcKcqiVSCibqtlOUQLZZl7lDgAVjPmg='
WHERE
key_id = '134cf27ee065b253732d682f3318af35d971716d9a40ecf90aeed2979ae253c9'
AND (
token = 'x0FvGAuP8WQPmcKcqiVSCibqtlOUQLZZl7lDgAVjPmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)