UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EORItE/k2R5UdJlLAqFOY6TIvDVYBLb1jvQ5eZ0jnfE='
WHERE
key_id = 'c7de072897198b914e930a20ff49aa7458150ba0f46e5674917497073b1d5398'
AND (
token = 'EORItE/k2R5UdJlLAqFOY6TIvDVYBLb1jvQ5eZ0jnfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)