UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H94G+Ayw1+EdGeDGZSV+Ke2rrgccytLR15qvRMKltCI='
WHERE
key_id = '71e2f94ee20f4f866a1be977cdbcdd0f6562199d3d03ac6f1e287f226054e2cc'
AND (
token = 'H94G+Ayw1+EdGeDGZSV+Ke2rrgccytLR15qvRMKltCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)