UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UEhy6KuFERzbbN48ns3RcxppL1WGLnUiwLR6mB6BX6c=' 
WHERE 
  key_id = '708a5335d2a4dfa0a270fc2da0c9a0b61e5a824f8998398e0d9b8200ba64a01f' 
  AND (
    token = 'UEhy6KuFERzbbN48ns3RcxppL1WGLnUiwLR6mB6BX6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043