UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7fCUv/o68GYE3u22cYyJZVnEazvkMPZSmfk0ve+aCm0=' 
WHERE 
  key_id = 'da063eba00314eb167f77d1ea72f50fc0fb30ce16fab2af3e10758ee69241a60' 
  AND (
    token = '7fCUv/o68GYE3u22cYyJZVnEazvkMPZSmfk0ve+aCm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037