UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RwRZ8pO3YrZY3X/ErduFShv7MQDwhEqbgueKHZNAUqQ=' 
WHERE 
  key_id = 'acac3ee5dbc3b99b54e8bdebc4f3552f70a3f212787db3414dc5f3edae0b0472' 
  AND (
    token = 'RwRZ8pO3YrZY3X/ErduFShv7MQDwhEqbgueKHZNAUqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040