UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hiMhkPCGXym4oUfBsHR5Di2C6GA3KljUOxyejiV7/g8='
WHERE
key_id = 'dfbe4469b96eddd1afb798aca9e365a0c178df2d66f08cc4052e20d12bb1a765'
AND (
token = 'hiMhkPCGXym4oUfBsHR5Di2C6GA3KljUOxyejiV7/g8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)