UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'la1LXIXVq42w1ZB1Z+xpfBmbnbnsc2+bhCPMeCjT7js=' 
WHERE 
  key_id = 'f34268b9306c7f548c9cd5d00717ee1dce1a55f91927ce75627bc692e9d5257d' 
  AND (
    token = 'la1LXIXVq42w1ZB1Z+xpfBmbnbnsc2+bhCPMeCjT7js=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034