UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TuatQmRlCm6gI1IEsWh6TLOER13Snfm/awEicRuE8x8='
WHERE
key_id = '0870ab21c2ba50c325ca0b7845206af8af77a46cb40b15bf898acb985bc5cc89'
AND (
token = 'TuatQmRlCm6gI1IEsWh6TLOER13Snfm/awEicRuE8x8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)