UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RxTdcesmX7PHhgvOa964GCh+bB3EJVJ38gVJVRPtMDg=' 
WHERE 
  key_id = '9df01b1f6f6e849a1f4f17bc8eb361d50c59dcda87f8cde55b3b369bc789a9a6' 
  AND (
    token = 'RxTdcesmX7PHhgvOa964GCh+bB3EJVJ38gVJVRPtMDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036