UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n6ws/SUTbPXRz50klN9a6Gta+QC5ETNdZjaF8/2RHhw='
WHERE
key_id = '7c94e4d5b5162a5845d1d1d4d8ce0a5158c3e366a26555f3749a77883ca41309'
AND (
token = 'n6ws/SUTbPXRz50klN9a6Gta+QC5ETNdZjaF8/2RHhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)